#include "../Delta-Ray/input.h"

Input::Input(){
    //konstruktor
    key = 0xFF; //255 = NULL char
    KeyU = KeyD = Quit = false;
}

void Input::UpdateKey(){
    SDL_PollEvent(&Event);

    if(Event.type == SDL_KEYDOWN){
        KeyD = true;
		if(Event.key.keysym.sym == SDLK_BACKSPACE) key = KEY_BACKSPACE;
		if(Event.key.keysym.sym == SDLK_TAB) key = KEY_TAB;
		if(Event.key.keysym.sym == SDLK_CLEAR) key = KEY_CLEAR;
		if(Event.key.keysym.sym == SDLK_RETURN) key = KEY_RETURN;
		if(Event.key.keysym.sym == SDLK_PAUSE) key = KEY_PAUSE;
		if(Event.key.keysym.sym == SDLK_ESCAPE) key = KEY_ESCAPE;
		if(Event.key.keysym.sym == SDLK_SPACE) key = KEY_SPACE;
		if(Event.key.keysym.sym == SDLK_EXCLAIM) key = KEY_EXCLAIM;
		if(Event.key.keysym.sym == SDLK_QUOTEDBL) key = KEY_QUOTEDBL;
		if(Event.key.keysym.sym == SDLK_HASH) key = KEY_HASH;
		if(Event.key.keysym.sym == SDLK_DOLLAR) key = KEY_DOLLAR;
		if(Event.key.keysym.sym == SDLK_AMPERSAND) key = KEY_AMPERSAND;
		if(Event.key.keysym.sym == SDLK_QUOTE) key = KEY_QUOTE;
		if(Event.key.keysym.sym == SDLK_LEFTPAREN) key = KEY_LEFTPAREN;
		if(Event.key.keysym.sym == SDLK_RIGHTPAREN) key = KEY_RIGHTPAREN;
		if(Event.key.keysym.sym == SDLK_ASTERISK) key = KEY_ASTERISK;
		if(Event.key.keysym.sym == SDLK_PLUS) key = KEY_PLUS;
		if(Event.key.keysym.sym == SDLK_COMMA) key = KEY_COMMA;
		if(Event.key.keysym.sym == SDLK_MINUS) key = KEY_MINUS;
		if(Event.key.keysym.sym == SDLK_PERIOD) key = KEY_PERIOD;
		if(Event.key.keysym.sym == SDLK_SLASH) key = KEY_SLASH;
		if(Event.key.keysym.sym == SDLK_0) key = KEY_0;
		if(Event.key.keysym.sym == SDLK_1) key = KEY_1;
		if(Event.key.keysym.sym == SDLK_2) key = KEY_2;
		if(Event.key.keysym.sym == SDLK_3) key = KEY_3;
		if(Event.key.keysym.sym == SDLK_4) key = KEY_4;
		if(Event.key.keysym.sym == SDLK_5) key = KEY_5;
		if(Event.key.keysym.sym == SDLK_6) key = KEY_6;
		if(Event.key.keysym.sym == SDLK_7) key = KEY_7;
		if(Event.key.keysym.sym == SDLK_8) key = KEY_8;
		if(Event.key.keysym.sym == SDLK_9) key = KEY_9;
		if(Event.key.keysym.sym == SDLK_COLON) key = KEY_COLON;
		if(Event.key.keysym.sym == SDLK_SEMICOLON) key = KEY_SEMICOLON;
		if(Event.key.keysym.sym == SDLK_LESS) key = KEY_LESS;
		if(Event.key.keysym.sym == SDLK_EQUALS) key = KEY_EQUALS;
		if(Event.key.keysym.sym == SDLK_GREATER) key = KEY_GREATER;
		if(Event.key.keysym.sym == SDLK_QUESTION) key = KEY_QUESTION;
		if(Event.key.keysym.sym == SDLK_AT) key = KEY_AT;
		if(Event.key.keysym.sym == SDLK_LEFTBRACKET) key = KEY_LEFTBRACKET;
		if(Event.key.keysym.sym == SDLK_BACKSLASH) key = KEY_BACKSLASH;
		if(Event.key.keysym.sym == SDLK_RIGHTBRACKET) key = KEY_RIGHTBRACKET;
		if(Event.key.keysym.sym == SDLK_CARET) key = KEY_CARET;
		if(Event.key.keysym.sym == SDLK_UNDERSCORE) key = KEY_UNDERSCORE;
		if(Event.key.keysym.sym == SDLK_BACKQUOTE) key = KEY_BACKQUOTE;
		if(Event.key.keysym.sym == SDLK_a) key = KEY_a;
		if(Event.key.keysym.sym == SDLK_b) key = KEY_b;
		if(Event.key.keysym.sym == SDLK_c) key = KEY_c;
		if(Event.key.keysym.sym == SDLK_d) key = KEY_d;
		if(Event.key.keysym.sym == SDLK_e) key = KEY_e;
		if(Event.key.keysym.sym == SDLK_f) key = KEY_f;
		if(Event.key.keysym.sym == SDLK_g) key = KEY_g;
		if(Event.key.keysym.sym == SDLK_h) key = KEY_h;
		if(Event.key.keysym.sym == SDLK_i) key = KEY_i;
		if(Event.key.keysym.sym == SDLK_j) key = KEY_j;
		if(Event.key.keysym.sym == SDLK_k) key = KEY_k;
		if(Event.key.keysym.sym == SDLK_l) key = KEY_l;
		if(Event.key.keysym.sym == SDLK_m) key = KEY_m;
		if(Event.key.keysym.sym == SDLK_n) key = KEY_n;
		if(Event.key.keysym.sym == SDLK_o) key = KEY_o;
		if(Event.key.keysym.sym == SDLK_p) key = KEY_p;
		if(Event.key.keysym.sym == SDLK_q) key = KEY_q;
		if(Event.key.keysym.sym == SDLK_r) key = KEY_r;
		if(Event.key.keysym.sym == SDLK_s) key = KEY_s;
		if(Event.key.keysym.sym == SDLK_t) key = KEY_t;
		if(Event.key.keysym.sym == SDLK_u) key = KEY_u;
		if(Event.key.keysym.sym == SDLK_v) key = KEY_v;
		if(Event.key.keysym.sym == SDLK_w) key = KEY_w;
		if(Event.key.keysym.sym == SDLK_x) key = KEY_x;
		if(Event.key.keysym.sym == SDLK_y) key = KEY_y;
		if(Event.key.keysym.sym == SDLK_z) key = KEY_z;
		if(Event.key.keysym.sym == SDLK_DELETE) key = KEY_DELETE;
		if(Event.key.keysym.sym == SDLK_KP0) key = KEY_KP0;
		if(Event.key.keysym.sym == SDLK_KP1) key = KEY_KP1;
		if(Event.key.keysym.sym == SDLK_KP2) key = KEY_KP2;
		if(Event.key.keysym.sym == SDLK_KP3) key = KEY_KP3;
		if(Event.key.keysym.sym == SDLK_KP4) key = KEY_KP4;
		if(Event.key.keysym.sym == SDLK_KP5) key = KEY_KP5;
		if(Event.key.keysym.sym == SDLK_KP6) key = KEY_KP6;
		if(Event.key.keysym.sym == SDLK_KP7) key = KEY_KP7;
		if(Event.key.keysym.sym == SDLK_KP8) key = KEY_KP8;
		if(Event.key.keysym.sym == SDLK_KP9) key = KEY_KP9;
		if(Event.key.keysym.sym == SDLK_KP_PERIOD) key = KEY_KP_PERIOD;
		if(Event.key.keysym.sym == SDLK_KP_DIVIDE) key = KEY_KP_DIVIDE;
		if(Event.key.keysym.sym == SDLK_KP_MULTIPLY) key = KEY_KP_MULTIPLY;
		if(Event.key.keysym.sym == SDLK_KP_MINUS) key = KEY_KP_MINUS;
		if(Event.key.keysym.sym == SDLK_KP_PLUS) key = KEY_KP_PLUS;
		if(Event.key.keysym.sym == SDLK_KP_ENTER) key = KEY_KP_ENTER;
		if(Event.key.keysym.sym == SDLK_KP_EQUALS) key = KEY_KP_EQUALS;
		if(Event.key.keysym.sym == SDLK_UP) key = KEY_UP;
		if(Event.key.keysym.sym == SDLK_DOWN) key = KEY_DOWN;
		if(Event.key.keysym.sym == SDLK_RIGHT) key = KEY_RIGHT;
		if(Event.key.keysym.sym == SDLK_LEFT) key = KEY_LEFT;
		if(Event.key.keysym.sym == SDLK_INSERT) key = KEY_INSERT;
		if(Event.key.keysym.sym == SDLK_HOME) key = KEY_HOME;
		if(Event.key.keysym.sym == SDLK_END) key = KEY_END;
		if(Event.key.keysym.sym == SDLK_PAGEUP) key = KEY_PAGEUP;
		if(Event.key.keysym.sym == SDLK_PAGEDOWN) key = KEY_PAGEDOWN;
		if(Event.key.keysym.sym == SDLK_F1) key = KEY_F1;
		if(Event.key.keysym.sym == SDLK_F2) key = KEY_F2;
		if(Event.key.keysym.sym == SDLK_F3) key = KEY_F3;
		if(Event.key.keysym.sym == SDLK_F4) key = KEY_F4;
		if(Event.key.keysym.sym == SDLK_F5) key = KEY_F5;
		if(Event.key.keysym.sym == SDLK_F6) key = KEY_F6;
		if(Event.key.keysym.sym == SDLK_F7) key = KEY_F7;
		if(Event.key.keysym.sym == SDLK_F8) key = KEY_F8;
		if(Event.key.keysym.sym == SDLK_F9) key = KEY_F9;
		if(Event.key.keysym.sym == SDLK_F10) key = KEY_F10;
		if(Event.key.keysym.sym == SDLK_F11) key = KEY_F11;
		if(Event.key.keysym.sym == SDLK_F12) key = KEY_F12;
		if(Event.key.keysym.sym == SDLK_F13) key = KEY_F13;
		if(Event.key.keysym.sym == SDLK_F14) key = KEY_F14;
		if(Event.key.keysym.sym == SDLK_F15) key = KEY_F15;
		if(Event.key.keysym.sym == SDLK_NUMLOCK) key = KEY_NUMLOCK;
		if(Event.key.keysym.sym == SDLK_CAPSLOCK) key = KEY_CAPSLOCK;
		if(Event.key.keysym.sym == SDLK_SCROLLOCK) key = KEY_SCROLLOCK;
		if(Event.key.keysym.sym == SDLK_RSHIFT) key = KEY_RSHIFT;
		if(Event.key.keysym.sym == SDLK_LSHIFT) key = KEY_LSHIFT;
		if(Event.key.keysym.sym == SDLK_RCTRL) key = KEY_RCTRL;
		if(Event.key.keysym.sym == SDLK_LCTRL) key = KEY_LCTRL;
		if(Event.key.keysym.sym == SDLK_RALT) key = KEY_RALT;
		if(Event.key.keysym.sym == SDLK_LALT) key = KEY_LALT;
		if(Event.key.keysym.sym == SDLK_RMETA) key = KEY_RMETA;
		if(Event.key.keysym.sym == SDLK_LMETA) key = KEY_LMETA;
		if(Event.key.keysym.sym == SDLK_LSUPER) key = KEY_LSUPER;
		if(Event.key.keysym.sym == SDLK_RSUPER) key = KEY_RSUPER;
		if(Event.key.keysym.sym == SDLK_MODE) key = KEY_MODE;
		if(Event.key.keysym.sym == SDLK_COMPOSE) key = KEY_COMPOSE;
		if(Event.key.keysym.sym == SDLK_HELP) key = KEY_HELP;
		if(Event.key.keysym.sym == SDLK_PRINT) key = KEY_PRINT;
		if(Event.key.keysym.sym == SDLK_SYSREQ) key = KEY_SYSREQ;
		if(Event.key.keysym.sym == SDLK_BREAK) key = KEY_BREAK;
		if(Event.key.keysym.sym == SDLK_MENU) key = KEY_MENU;
		if(Event.key.keysym.sym == SDLK_POWER) key = KEY_POWER;
		if(Event.key.keysym.sym == SDLK_EURO) key = KEY_EURO;
		if(Event.key.keysym.sym == SDLK_UNDO) key = KEY_UNDO;
		/*if(Event.key.keysym.sym == SDLK_EMP_136) key = KEY_EMP_136;
		if(Event.key.keysym.sym == SDLK_EMP_137) key = KEY_EMP_137;
		if(Event.key.keysym.sym == SDLK_EMP_138) key = KEY_EMP_138;
		if(Event.key.keysym.sym == SDLK_EMP_139) key = KEY_EMP_139;
		if(Event.key.keysym.sym == SDLK_EMP_140) key = KEY_EMP_140;
		if(Event.key.keysym.sym == SDLK_EMP_141) key = KEY_EMP_141;
		if(Event.key.keysym.sym == SDLK_EMP_142) key = KEY_EMP_142;
		if(Event.key.keysym.sym == SDLK_EMP_143) key = KEY_EMP_143;
		if(Event.key.keysym.sym == SDLK_EMP_144) key = KEY_EMP_144;
		if(Event.key.keysym.sym == SDLK_EMP_145) key = KEY_EMP_145;
		if(Event.key.keysym.sym == SDLK_EMP_146) key = KEY_EMP_146;
		if(Event.key.keysym.sym == SDLK_EMP_147) key = KEY_EMP_147;
		if(Event.key.keysym.sym == SDLK_EMP_148) key = KEY_EMP_148;
		if(Event.key.keysym.sym == SDLK_EMP_149) key = KEY_EMP_149;
		if(Event.key.keysym.sym == SDLK_EMP_150) key = KEY_EMP_150;
		if(Event.key.keysym.sym == SDLK_EMP_151) key = KEY_EMP_151;
		if(Event.key.keysym.sym == SDLK_EMP_152) key = KEY_EMP_152;
		if(Event.key.keysym.sym == SDLK_EMP_153) key = KEY_EMP_153;
		if(Event.key.keysym.sym == SDLK_EMP_154) key = KEY_EMP_154;
		if(Event.key.keysym.sym == SDLK_EMP_155) key = KEY_EMP_155;
		if(Event.key.keysym.sym == SDLK_EMP_156) key = KEY_EMP_156;
		if(Event.key.keysym.sym == SDLK_EMP_157) key = KEY_EMP_157;
		if(Event.key.keysym.sym == SDLK_EMP_158) key = KEY_EMP_158;
		if(Event.key.keysym.sym == SDLK_EMP_159) key = KEY_EMP_159;
		if(Event.key.keysym.sym == SDLK_EMP_160) key = KEY_EMP_160;
		if(Event.key.keysym.sym == SDLK_EMP_161) key = KEY_EMP_161;
		if(Event.key.keysym.sym == SDLK_EMP_162) key = KEY_EMP_162;
		if(Event.key.keysym.sym == SDLK_EMP_163) key = KEY_EMP_163;
		if(Event.key.keysym.sym == SDLK_EMP_164) key = KEY_EMP_164;
		if(Event.key.keysym.sym == SDLK_EMP_165) key = KEY_EMP_165;
		if(Event.key.keysym.sym == SDLK_EMP_166) key = KEY_EMP_166;
		if(Event.key.keysym.sym == SDLK_EMP_167) key = KEY_EMP_167;
		if(Event.key.keysym.sym == SDLK_EMP_168) key = KEY_EMP_168;
		if(Event.key.keysym.sym == SDLK_EMP_169) key = KEY_EMP_169;
		if(Event.key.keysym.sym == SDLK_EMP_170) key = KEY_EMP_170;
		if(Event.key.keysym.sym == SDLK_EMP_171) key = KEY_EMP_171;
		if(Event.key.keysym.sym == SDLK_EMP_172) key = KEY_EMP_172;
		if(Event.key.keysym.sym == SDLK_EMP_173) key = KEY_EMP_173;
		if(Event.key.keysym.sym == SDLK_EMP_174) key = KEY_EMP_174;
		if(Event.key.keysym.sym == SDLK_EMP_175) key = KEY_EMP_175;
		if(Event.key.keysym.sym == SDLK_EMP_176) key = KEY_EMP_176;
		if(Event.key.keysym.sym == SDLK_EMP_177) key = KEY_EMP_177;
		if(Event.key.keysym.sym == SDLK_EMP_178) key = KEY_EMP_178;
		if(Event.key.keysym.sym == SDLK_EMP_179) key = KEY_EMP_179;
		if(Event.key.keysym.sym == SDLK_EMP_180) key = KEY_EMP_180;
		if(Event.key.keysym.sym == SDLK_EMP_181) key = KEY_EMP_181;
		if(Event.key.keysym.sym == SDLK_EMP_182) key = KEY_EMP_182;
		if(Event.key.keysym.sym == SDLK_EMP_183) key = KEY_EMP_183;
		if(Event.key.keysym.sym == SDLK_EMP_184) key = KEY_EMP_184;
		if(Event.key.keysym.sym == SDLK_EMP_185) key = KEY_EMP_185;
		if(Event.key.keysym.sym == SDLK_EMP_186) key = KEY_EMP_186;
		if(Event.key.keysym.sym == SDLK_EMP_187) key = KEY_EMP_187;
		if(Event.key.keysym.sym == SDLK_EMP_188) key = KEY_EMP_188;
		if(Event.key.keysym.sym == SDLK_EMP_189) key = KEY_EMP_189;
		if(Event.key.keysym.sym == SDLK_EMP_190) key = KEY_EMP_190;
		if(Event.key.keysym.sym == SDLK_EMP_191) key = KEY_EMP_191;
		if(Event.key.keysym.sym == SDLK_EMP_192) key = KEY_EMP_192;
		if(Event.key.keysym.sym == SDLK_EMP_193) key = KEY_EMP_193;
		if(Event.key.keysym.sym == SDLK_EMP_194) key = KEY_EMP_194;
		if(Event.key.keysym.sym == SDLK_EMP_195) key = KEY_EMP_195;
		if(Event.key.keysym.sym == SDLK_EMP_196) key = KEY_EMP_196;
		if(Event.key.keysym.sym == SDLK_EMP_197) key = KEY_EMP_197;
		if(Event.key.keysym.sym == SDLK_EMP_198) key = KEY_EMP_198;
		if(Event.key.keysym.sym == SDLK_EMP_199) key = KEY_EMP_199;
		if(Event.key.keysym.sym == SDLK_EMP_200) key = KEY_EMP_200;
		if(Event.key.keysym.sym == SDLK_EMP_201) key = KEY_EMP_201;
		if(Event.key.keysym.sym == SDLK_EMP_202) key = KEY_EMP_202;
		if(Event.key.keysym.sym == SDLK_EMP_203) key = KEY_EMP_203;
		if(Event.key.keysym.sym == SDLK_EMP_204) key = KEY_EMP_204;
		if(Event.key.keysym.sym == SDLK_EMP_205) key = KEY_EMP_205;
		if(Event.key.keysym.sym == SDLK_EMP_206) key = KEY_EMP_206;
		if(Event.key.keysym.sym == SDLK_EMP_207) key = KEY_EMP_207;
		if(Event.key.keysym.sym == SDLK_EMP_208) key = KEY_EMP_208;
		if(Event.key.keysym.sym == SDLK_EMP_209) key = KEY_EMP_209;
		if(Event.key.keysym.sym == SDLK_EMP_210) key = KEY_EMP_210;
		if(Event.key.keysym.sym == SDLK_EMP_211) key = KEY_EMP_211;
		if(Event.key.keysym.sym == SDLK_EMP_212) key = KEY_EMP_212;
		if(Event.key.keysym.sym == SDLK_EMP_213) key = KEY_EMP_213;
		if(Event.key.keysym.sym == SDLK_EMP_214) key = KEY_EMP_214;
		if(Event.key.keysym.sym == SDLK_EMP_215) key = KEY_EMP_215;
		if(Event.key.keysym.sym == SDLK_EMP_216) key = KEY_EMP_216;
		if(Event.key.keysym.sym == SDLK_EMP_217) key = KEY_EMP_217;
		if(Event.key.keysym.sym == SDLK_EMP_218) key = KEY_EMP_218;
		if(Event.key.keysym.sym == SDLK_EMP_219) key = KEY_EMP_219;
		if(Event.key.keysym.sym == SDLK_EMP_220) key = KEY_EMP_220;
		if(Event.key.keysym.sym == SDLK_EMP_221) key = KEY_EMP_221;
		if(Event.key.keysym.sym == SDLK_EMP_222) key = KEY_EMP_222;
		if(Event.key.keysym.sym == SDLK_EMP_223) key = KEY_EMP_223;
		if(Event.key.keysym.sym == SDLK_EMP_224) key = KEY_EMP_224;
		if(Event.key.keysym.sym == SDLK_EMP_225) key = KEY_EMP_225;
		if(Event.key.keysym.sym == SDLK_EMP_226) key = KEY_EMP_226;
		if(Event.key.keysym.sym == SDLK_EMP_227) key = KEY_EMP_227;
		if(Event.key.keysym.sym == SDLK_EMP_228) key = KEY_EMP_228;
		if(Event.key.keysym.sym == SDLK_EMP_229) key = KEY_EMP_229;
		if(Event.key.keysym.sym == SDLK_EMP_230) key = KEY_EMP_230;
		if(Event.key.keysym.sym == SDLK_EMP_231) key = KEY_EMP_231;
		if(Event.key.keysym.sym == SDLK_EMP_232) key = KEY_EMP_232;
		if(Event.key.keysym.sym == SDLK_EMP_233) key = KEY_EMP_233;
		if(Event.key.keysym.sym == SDLK_EMP_234) key = KEY_EMP_234;
		if(Event.key.keysym.sym == SDLK_EMP_235) key = KEY_EMP_235;
		if(Event.key.keysym.sym == SDLK_EMP_236) key = KEY_EMP_236;
		if(Event.key.keysym.sym == SDLK_EMP_237) key = KEY_EMP_237;
		if(Event.key.keysym.sym == SDLK_EMP_238) key = KEY_EMP_238;
		if(Event.key.keysym.sym == SDLK_EMP_239) key = KEY_EMP_239;
		if(Event.key.keysym.sym == SDLK_EMP_240) key = KEY_EMP_240;
		if(Event.key.keysym.sym == SDLK_EMP_241) key = KEY_EMP_241;
		if(Event.key.keysym.sym == SDLK_EMP_242) key = KEY_EMP_242;
		if(Event.key.keysym.sym == SDLK_EMP_243) key = KEY_EMP_243;
		if(Event.key.keysym.sym == SDLK_EMP_244) key = KEY_EMP_244;
		if(Event.key.keysym.sym == SDLK_EMP_245) key = KEY_EMP_245;
		if(Event.key.keysym.sym == SDLK_EMP_246) key = KEY_EMP_246;
		if(Event.key.keysym.sym == SDLK_EMP_247) key = KEY_EMP_247;
		if(Event.key.keysym.sym == SDLK_EMP_248) key = KEY_EMP_248;
		if(Event.key.keysym.sym == SDLK_EMP_249) key = KEY_EMP_249;
		if(Event.key.keysym.sym == SDLK_EMP_250) key = KEY_EMP_250;
		if(Event.key.keysym.sym == SDLK_EMP_251) key = KEY_EMP_251;
		if(Event.key.keysym.sym == SDLK_EMP_252) key = KEY_EMP_252;
		if(Event.key.keysym.sym == SDLK_EMP_253) key = KEY_EMP_253;
		if(Event.key.keysym.sym == SDLK_EMP_254) key = KEY_EMP_254;*/
    }
    else KeyD = false;

    if(Event.type == SDL_KEYUP){
        KeyU = true;
		if(Event.key.keysym.sym == SDLK_BACKSPACE) key = KEY_BACKSPACE;
		if(Event.key.keysym.sym == SDLK_TAB) key = KEY_TAB;
		if(Event.key.keysym.sym == SDLK_CLEAR) key = KEY_CLEAR;
		if(Event.key.keysym.sym == SDLK_RETURN) key = KEY_RETURN;
		if(Event.key.keysym.sym == SDLK_PAUSE) key = KEY_PAUSE;
		if(Event.key.keysym.sym == SDLK_ESCAPE) key = KEY_ESCAPE;
		if(Event.key.keysym.sym == SDLK_SPACE) key = KEY_SPACE;
		if(Event.key.keysym.sym == SDLK_EXCLAIM) key = KEY_EXCLAIM;
		if(Event.key.keysym.sym == SDLK_QUOTEDBL) key = KEY_QUOTEDBL;
		if(Event.key.keysym.sym == SDLK_HASH) key = KEY_HASH;
		if(Event.key.keysym.sym == SDLK_DOLLAR) key = KEY_DOLLAR;
		if(Event.key.keysym.sym == SDLK_AMPERSAND) key = KEY_AMPERSAND;
		if(Event.key.keysym.sym == SDLK_QUOTE) key = KEY_QUOTE;
		if(Event.key.keysym.sym == SDLK_LEFTPAREN) key = KEY_LEFTPAREN;
		if(Event.key.keysym.sym == SDLK_RIGHTPAREN) key = KEY_RIGHTPAREN;
		if(Event.key.keysym.sym == SDLK_ASTERISK) key = KEY_ASTERISK;
		if(Event.key.keysym.sym == SDLK_PLUS) key = KEY_PLUS;
		if(Event.key.keysym.sym == SDLK_COMMA) key = KEY_COMMA;
		if(Event.key.keysym.sym == SDLK_MINUS) key = KEY_MINUS;
		if(Event.key.keysym.sym == SDLK_PERIOD) key = KEY_PERIOD;
		if(Event.key.keysym.sym == SDLK_SLASH) key = KEY_SLASH;
		if(Event.key.keysym.sym == SDLK_0) key = KEY_0;
		if(Event.key.keysym.sym == SDLK_1) key = KEY_1;
		if(Event.key.keysym.sym == SDLK_2) key = KEY_2;
		if(Event.key.keysym.sym == SDLK_3) key = KEY_3;
		if(Event.key.keysym.sym == SDLK_4) key = KEY_4;
		if(Event.key.keysym.sym == SDLK_5) key = KEY_5;
		if(Event.key.keysym.sym == SDLK_6) key = KEY_6;
		if(Event.key.keysym.sym == SDLK_7) key = KEY_7;
		if(Event.key.keysym.sym == SDLK_8) key = KEY_8;
		if(Event.key.keysym.sym == SDLK_9) key = KEY_9;
		if(Event.key.keysym.sym == SDLK_COLON) key = KEY_COLON;
		if(Event.key.keysym.sym == SDLK_SEMICOLON) key = KEY_SEMICOLON;
		if(Event.key.keysym.sym == SDLK_LESS) key = KEY_LESS;
		if(Event.key.keysym.sym == SDLK_EQUALS) key = KEY_EQUALS;
		if(Event.key.keysym.sym == SDLK_GREATER) key = KEY_GREATER;
		if(Event.key.keysym.sym == SDLK_QUESTION) key = KEY_QUESTION;
		if(Event.key.keysym.sym == SDLK_AT) key = KEY_AT;
		if(Event.key.keysym.sym == SDLK_LEFTBRACKET) key = KEY_LEFTBRACKET;
		if(Event.key.keysym.sym == SDLK_BACKSLASH) key = KEY_BACKSLASH;
		if(Event.key.keysym.sym == SDLK_RIGHTBRACKET) key = KEY_RIGHTBRACKET;
		if(Event.key.keysym.sym == SDLK_CARET) key = KEY_CARET;
		if(Event.key.keysym.sym == SDLK_UNDERSCORE) key = KEY_UNDERSCORE;
		if(Event.key.keysym.sym == SDLK_BACKQUOTE) key = KEY_BACKQUOTE;
		if(Event.key.keysym.sym == SDLK_a) key = KEY_a;
		if(Event.key.keysym.sym == SDLK_b) key = KEY_b;
		if(Event.key.keysym.sym == SDLK_c) key = KEY_c;
		if(Event.key.keysym.sym == SDLK_d) key = KEY_d;
		if(Event.key.keysym.sym == SDLK_e) key = KEY_e;
		if(Event.key.keysym.sym == SDLK_f) key = KEY_f;
		if(Event.key.keysym.sym == SDLK_g) key = KEY_g;
		if(Event.key.keysym.sym == SDLK_h) key = KEY_h;
		if(Event.key.keysym.sym == SDLK_i) key = KEY_i;
		if(Event.key.keysym.sym == SDLK_j) key = KEY_j;
		if(Event.key.keysym.sym == SDLK_k) key = KEY_k;
		if(Event.key.keysym.sym == SDLK_l) key = KEY_l;
		if(Event.key.keysym.sym == SDLK_m) key = KEY_m;
		if(Event.key.keysym.sym == SDLK_n) key = KEY_n;
		if(Event.key.keysym.sym == SDLK_o) key = KEY_o;
		if(Event.key.keysym.sym == SDLK_p) key = KEY_p;
		if(Event.key.keysym.sym == SDLK_q) key = KEY_q;
		if(Event.key.keysym.sym == SDLK_r) key = KEY_r;
		if(Event.key.keysym.sym == SDLK_s) key = KEY_s;
		if(Event.key.keysym.sym == SDLK_t) key = KEY_t;
		if(Event.key.keysym.sym == SDLK_u) key = KEY_u;
		if(Event.key.keysym.sym == SDLK_v) key = KEY_v;
		if(Event.key.keysym.sym == SDLK_w) key = KEY_w;
		if(Event.key.keysym.sym == SDLK_x) key = KEY_x;
		if(Event.key.keysym.sym == SDLK_y) key = KEY_y;
		if(Event.key.keysym.sym == SDLK_z) key = KEY_z;
		if(Event.key.keysym.sym == SDLK_DELETE) key = KEY_DELETE;
		if(Event.key.keysym.sym == SDLK_KP0) key = KEY_KP0;
		if(Event.key.keysym.sym == SDLK_KP1) key = KEY_KP1;
		if(Event.key.keysym.sym == SDLK_KP2) key = KEY_KP2;
		if(Event.key.keysym.sym == SDLK_KP3) key = KEY_KP3;
		if(Event.key.keysym.sym == SDLK_KP4) key = KEY_KP4;
		if(Event.key.keysym.sym == SDLK_KP5) key = KEY_KP5;
		if(Event.key.keysym.sym == SDLK_KP6) key = KEY_KP6;
		if(Event.key.keysym.sym == SDLK_KP7) key = KEY_KP7;
		if(Event.key.keysym.sym == SDLK_KP8) key = KEY_KP8;
		if(Event.key.keysym.sym == SDLK_KP9) key = KEY_KP9;
		if(Event.key.keysym.sym == SDLK_KP_PERIOD) key = KEY_KP_PERIOD;
		if(Event.key.keysym.sym == SDLK_KP_DIVIDE) key = KEY_KP_DIVIDE;
		if(Event.key.keysym.sym == SDLK_KP_MULTIPLY) key = KEY_KP_MULTIPLY;
		if(Event.key.keysym.sym == SDLK_KP_MINUS) key = KEY_KP_MINUS;
		if(Event.key.keysym.sym == SDLK_KP_PLUS) key = KEY_KP_PLUS;
		if(Event.key.keysym.sym == SDLK_KP_ENTER) key = KEY_KP_ENTER;
		if(Event.key.keysym.sym == SDLK_KP_EQUALS) key = KEY_KP_EQUALS;
		if(Event.key.keysym.sym == SDLK_UP) key = KEY_UP;
		if(Event.key.keysym.sym == SDLK_DOWN) key = KEY_DOWN;
		if(Event.key.keysym.sym == SDLK_RIGHT) key = KEY_RIGHT;
		if(Event.key.keysym.sym == SDLK_LEFT) key = KEY_LEFT;
		if(Event.key.keysym.sym == SDLK_INSERT) key = KEY_INSERT;
		if(Event.key.keysym.sym == SDLK_HOME) key = KEY_HOME;
		if(Event.key.keysym.sym == SDLK_END) key = KEY_END;
		if(Event.key.keysym.sym == SDLK_PAGEUP) key = KEY_PAGEUP;
		if(Event.key.keysym.sym == SDLK_PAGEDOWN) key = KEY_PAGEDOWN;
		if(Event.key.keysym.sym == SDLK_F1) key = KEY_F1;
		if(Event.key.keysym.sym == SDLK_F2) key = KEY_F2;
		if(Event.key.keysym.sym == SDLK_F3) key = KEY_F3;
		if(Event.key.keysym.sym == SDLK_F4) key = KEY_F4;
		if(Event.key.keysym.sym == SDLK_F5) key = KEY_F5;
		if(Event.key.keysym.sym == SDLK_F6) key = KEY_F6;
		if(Event.key.keysym.sym == SDLK_F7) key = KEY_F7;
		if(Event.key.keysym.sym == SDLK_F8) key = KEY_F8;
		if(Event.key.keysym.sym == SDLK_F9) key = KEY_F9;
		if(Event.key.keysym.sym == SDLK_F10) key = KEY_F10;
		if(Event.key.keysym.sym == SDLK_F11) key = KEY_F11;
		if(Event.key.keysym.sym == SDLK_F12) key = KEY_F12;
		if(Event.key.keysym.sym == SDLK_F13) key = KEY_F13;
		if(Event.key.keysym.sym == SDLK_F14) key = KEY_F14;
		if(Event.key.keysym.sym == SDLK_F15) key = KEY_F15;
		if(Event.key.keysym.sym == SDLK_NUMLOCK) key = KEY_NUMLOCK;
		if(Event.key.keysym.sym == SDLK_CAPSLOCK) key = KEY_CAPSLOCK;
		if(Event.key.keysym.sym == SDLK_SCROLLOCK) key = KEY_SCROLLOCK;
		if(Event.key.keysym.sym == SDLK_RSHIFT) key = KEY_RSHIFT;
		if(Event.key.keysym.sym == SDLK_LSHIFT) key = KEY_LSHIFT;
		if(Event.key.keysym.sym == SDLK_RCTRL) key = KEY_RCTRL;
		if(Event.key.keysym.sym == SDLK_LCTRL) key = KEY_LCTRL;
		if(Event.key.keysym.sym == SDLK_RALT) key = KEY_RALT;
		if(Event.key.keysym.sym == SDLK_LALT) key = KEY_LALT;
		if(Event.key.keysym.sym == SDLK_RMETA) key = KEY_RMETA;
		if(Event.key.keysym.sym == SDLK_LMETA) key = KEY_LMETA;
		if(Event.key.keysym.sym == SDLK_LSUPER) key = KEY_LSUPER;
		if(Event.key.keysym.sym == SDLK_RSUPER) key = KEY_RSUPER;
		if(Event.key.keysym.sym == SDLK_MODE) key = KEY_MODE;
		if(Event.key.keysym.sym == SDLK_COMPOSE) key = KEY_COMPOSE;
		if(Event.key.keysym.sym == SDLK_HELP) key = KEY_HELP;
		if(Event.key.keysym.sym == SDLK_PRINT) key = KEY_PRINT;
		if(Event.key.keysym.sym == SDLK_SYSREQ) key = KEY_SYSREQ;
		if(Event.key.keysym.sym == SDLK_BREAK) key = KEY_BREAK;
		if(Event.key.keysym.sym == SDLK_MENU) key = KEY_MENU;
		if(Event.key.keysym.sym == SDLK_POWER) key = KEY_POWER;
		if(Event.key.keysym.sym == SDLK_EURO) key = KEY_EURO;
		if(Event.key.keysym.sym == SDLK_UNDO) key = KEY_UNDO;
		/*if(Event.key.keysym.sym == SDLK_EMP_136) key = KEY_EMP_136;
		if(Event.key.keysym.sym == SDLK_EMP_137) key = KEY_EMP_137;
		if(Event.key.keysym.sym == SDLK_EMP_138) key = KEY_EMP_138;
		if(Event.key.keysym.sym == SDLK_EMP_139) key = KEY_EMP_139;
		if(Event.key.keysym.sym == SDLK_EMP_140) key = KEY_EMP_140;
		if(Event.key.keysym.sym == SDLK_EMP_141) key = KEY_EMP_141;
		if(Event.key.keysym.sym == SDLK_EMP_142) key = KEY_EMP_142;
		if(Event.key.keysym.sym == SDLK_EMP_143) key = KEY_EMP_143;
		if(Event.key.keysym.sym == SDLK_EMP_144) key = KEY_EMP_144;
		if(Event.key.keysym.sym == SDLK_EMP_145) key = KEY_EMP_145;
		if(Event.key.keysym.sym == SDLK_EMP_146) key = KEY_EMP_146;
		if(Event.key.keysym.sym == SDLK_EMP_147) key = KEY_EMP_147;
		if(Event.key.keysym.sym == SDLK_EMP_148) key = KEY_EMP_148;
		if(Event.key.keysym.sym == SDLK_EMP_149) key = KEY_EMP_149;
		if(Event.key.keysym.sym == SDLK_EMP_150) key = KEY_EMP_150;
		if(Event.key.keysym.sym == SDLK_EMP_151) key = KEY_EMP_151;
		if(Event.key.keysym.sym == SDLK_EMP_152) key = KEY_EMP_152;
		if(Event.key.keysym.sym == SDLK_EMP_153) key = KEY_EMP_153;
		if(Event.key.keysym.sym == SDLK_EMP_154) key = KEY_EMP_154;
		if(Event.key.keysym.sym == SDLK_EMP_155) key = KEY_EMP_155;
		if(Event.key.keysym.sym == SDLK_EMP_156) key = KEY_EMP_156;
		if(Event.key.keysym.sym == SDLK_EMP_157) key = KEY_EMP_157;
		if(Event.key.keysym.sym == SDLK_EMP_158) key = KEY_EMP_158;
		if(Event.key.keysym.sym == SDLK_EMP_159) key = KEY_EMP_159;
		if(Event.key.keysym.sym == SDLK_EMP_160) key = KEY_EMP_160;
		if(Event.key.keysym.sym == SDLK_EMP_161) key = KEY_EMP_161;
		if(Event.key.keysym.sym == SDLK_EMP_162) key = KEY_EMP_162;
		if(Event.key.keysym.sym == SDLK_EMP_163) key = KEY_EMP_163;
		if(Event.key.keysym.sym == SDLK_EMP_164) key = KEY_EMP_164;
		if(Event.key.keysym.sym == SDLK_EMP_165) key = KEY_EMP_165;
		if(Event.key.keysym.sym == SDLK_EMP_166) key = KEY_EMP_166;
		if(Event.key.keysym.sym == SDLK_EMP_167) key = KEY_EMP_167;
		if(Event.key.keysym.sym == SDLK_EMP_168) key = KEY_EMP_168;
		if(Event.key.keysym.sym == SDLK_EMP_169) key = KEY_EMP_169;
		if(Event.key.keysym.sym == SDLK_EMP_170) key = KEY_EMP_170;
		if(Event.key.keysym.sym == SDLK_EMP_171) key = KEY_EMP_171;
		if(Event.key.keysym.sym == SDLK_EMP_172) key = KEY_EMP_172;
		if(Event.key.keysym.sym == SDLK_EMP_173) key = KEY_EMP_173;
		if(Event.key.keysym.sym == SDLK_EMP_174) key = KEY_EMP_174;
		if(Event.key.keysym.sym == SDLK_EMP_175) key = KEY_EMP_175;
		if(Event.key.keysym.sym == SDLK_EMP_176) key = KEY_EMP_176;
		if(Event.key.keysym.sym == SDLK_EMP_177) key = KEY_EMP_177;
		if(Event.key.keysym.sym == SDLK_EMP_178) key = KEY_EMP_178;
		if(Event.key.keysym.sym == SDLK_EMP_179) key = KEY_EMP_179;
		if(Event.key.keysym.sym == SDLK_EMP_180) key = KEY_EMP_180;
		if(Event.key.keysym.sym == SDLK_EMP_181) key = KEY_EMP_181;
		if(Event.key.keysym.sym == SDLK_EMP_182) key = KEY_EMP_182;
		if(Event.key.keysym.sym == SDLK_EMP_183) key = KEY_EMP_183;
		if(Event.key.keysym.sym == SDLK_EMP_184) key = KEY_EMP_184;
		if(Event.key.keysym.sym == SDLK_EMP_185) key = KEY_EMP_185;
		if(Event.key.keysym.sym == SDLK_EMP_186) key = KEY_EMP_186;
		if(Event.key.keysym.sym == SDLK_EMP_187) key = KEY_EMP_187;
		if(Event.key.keysym.sym == SDLK_EMP_188) key = KEY_EMP_188;
		if(Event.key.keysym.sym == SDLK_EMP_189) key = KEY_EMP_189;
		if(Event.key.keysym.sym == SDLK_EMP_190) key = KEY_EMP_190;
		if(Event.key.keysym.sym == SDLK_EMP_191) key = KEY_EMP_191;
		if(Event.key.keysym.sym == SDLK_EMP_192) key = KEY_EMP_192;
		if(Event.key.keysym.sym == SDLK_EMP_193) key = KEY_EMP_193;
		if(Event.key.keysym.sym == SDLK_EMP_194) key = KEY_EMP_194;
		if(Event.key.keysym.sym == SDLK_EMP_195) key = KEY_EMP_195;
		if(Event.key.keysym.sym == SDLK_EMP_196) key = KEY_EMP_196;
		if(Event.key.keysym.sym == SDLK_EMP_197) key = KEY_EMP_197;
		if(Event.key.keysym.sym == SDLK_EMP_198) key = KEY_EMP_198;
		if(Event.key.keysym.sym == SDLK_EMP_199) key = KEY_EMP_199;
		if(Event.key.keysym.sym == SDLK_EMP_200) key = KEY_EMP_200;
		if(Event.key.keysym.sym == SDLK_EMP_201) key = KEY_EMP_201;
		if(Event.key.keysym.sym == SDLK_EMP_202) key = KEY_EMP_202;
		if(Event.key.keysym.sym == SDLK_EMP_203) key = KEY_EMP_203;
		if(Event.key.keysym.sym == SDLK_EMP_204) key = KEY_EMP_204;
		if(Event.key.keysym.sym == SDLK_EMP_205) key = KEY_EMP_205;
		if(Event.key.keysym.sym == SDLK_EMP_206) key = KEY_EMP_206;
		if(Event.key.keysym.sym == SDLK_EMP_207) key = KEY_EMP_207;
		if(Event.key.keysym.sym == SDLK_EMP_208) key = KEY_EMP_208;
		if(Event.key.keysym.sym == SDLK_EMP_209) key = KEY_EMP_209;
		if(Event.key.keysym.sym == SDLK_EMP_210) key = KEY_EMP_210;
		if(Event.key.keysym.sym == SDLK_EMP_211) key = KEY_EMP_211;
		if(Event.key.keysym.sym == SDLK_EMP_212) key = KEY_EMP_212;
		if(Event.key.keysym.sym == SDLK_EMP_213) key = KEY_EMP_213;
		if(Event.key.keysym.sym == SDLK_EMP_214) key = KEY_EMP_214;
		if(Event.key.keysym.sym == SDLK_EMP_215) key = KEY_EMP_215;
		if(Event.key.keysym.sym == SDLK_EMP_216) key = KEY_EMP_216;
		if(Event.key.keysym.sym == SDLK_EMP_217) key = KEY_EMP_217;
		if(Event.key.keysym.sym == SDLK_EMP_218) key = KEY_EMP_218;
		if(Event.key.keysym.sym == SDLK_EMP_219) key = KEY_EMP_219;
		if(Event.key.keysym.sym == SDLK_EMP_220) key = KEY_EMP_220;
		if(Event.key.keysym.sym == SDLK_EMP_221) key = KEY_EMP_221;
		if(Event.key.keysym.sym == SDLK_EMP_222) key = KEY_EMP_222;
		if(Event.key.keysym.sym == SDLK_EMP_223) key = KEY_EMP_223;
		if(Event.key.keysym.sym == SDLK_EMP_224) key = KEY_EMP_224;
		if(Event.key.keysym.sym == SDLK_EMP_225) key = KEY_EMP_225;
		if(Event.key.keysym.sym == SDLK_EMP_226) key = KEY_EMP_226;
		if(Event.key.keysym.sym == SDLK_EMP_227) key = KEY_EMP_227;
		if(Event.key.keysym.sym == SDLK_EMP_228) key = KEY_EMP_228;
		if(Event.key.keysym.sym == SDLK_EMP_229) key = KEY_EMP_229;
		if(Event.key.keysym.sym == SDLK_EMP_230) key = KEY_EMP_230;
		if(Event.key.keysym.sym == SDLK_EMP_231) key = KEY_EMP_231;
		if(Event.key.keysym.sym == SDLK_EMP_232) key = KEY_EMP_232;
		if(Event.key.keysym.sym == SDLK_EMP_233) key = KEY_EMP_233;
		if(Event.key.keysym.sym == SDLK_EMP_234) key = KEY_EMP_234;
		if(Event.key.keysym.sym == SDLK_EMP_235) key = KEY_EMP_235;
		if(Event.key.keysym.sym == SDLK_EMP_236) key = KEY_EMP_236;
		if(Event.key.keysym.sym == SDLK_EMP_237) key = KEY_EMP_237;
		if(Event.key.keysym.sym == SDLK_EMP_238) key = KEY_EMP_238;
		if(Event.key.keysym.sym == SDLK_EMP_239) key = KEY_EMP_239;
		if(Event.key.keysym.sym == SDLK_EMP_240) key = KEY_EMP_240;
		if(Event.key.keysym.sym == SDLK_EMP_241) key = KEY_EMP_241;
		if(Event.key.keysym.sym == SDLK_EMP_242) key = KEY_EMP_242;
		if(Event.key.keysym.sym == SDLK_EMP_243) key = KEY_EMP_243;
		if(Event.key.keysym.sym == SDLK_EMP_244) key = KEY_EMP_244;
		if(Event.key.keysym.sym == SDLK_EMP_245) key = KEY_EMP_245;
		if(Event.key.keysym.sym == SDLK_EMP_246) key = KEY_EMP_246;
		if(Event.key.keysym.sym == SDLK_EMP_247) key = KEY_EMP_247;
		if(Event.key.keysym.sym == SDLK_EMP_248) key = KEY_EMP_248;
		if(Event.key.keysym.sym == SDLK_EMP_249) key = KEY_EMP_249;
		if(Event.key.keysym.sym == SDLK_EMP_250) key = KEY_EMP_250;
		if(Event.key.keysym.sym == SDLK_EMP_251) key = KEY_EMP_251;
		if(Event.key.keysym.sym == SDLK_EMP_252) key = KEY_EMP_252;
		if(Event.key.keysym.sym == SDLK_EMP_253) key = KEY_EMP_253;
		if(Event.key.keysym.sym == SDLK_EMP_254) key = KEY_EMP_254;*/
    }
    else KeyU = false;
    if(Event.type == SDL_QUIT) Quit = true;
}

unsigned char Input::GetLastKey(){
    return key;
}
bool Input::IsKeyDown(){
    return KeyD;
}
bool Input::IsKeyUp(){
    return KeyU;
}
bool Input::IsQuit(){
    return Quit;
}
